Skip to content

Bugfix/layer configuration#12

Merged
jdw-creare merged 6 commits intodevelopfrom
bugfix/layer_configuration
Jan 2, 2026
Merged

Bugfix/layer configuration#12
jdw-creare merged 6 commits intodevelopfrom
bugfix/layer_configuration

Conversation

@scranford1
Copy link
Copy Markdown

@scranford1 scranford1 commented Dec 23, 2025

Additional fixes for the EDR endpoints:

  • Fix initialization failure due to unpicklable layers. (The configuration requires that all items are deep copyable which we cannot guarantee depending on the layer, so layers were moved back out of the configuration file).
  • Reconvert temporal coordinates on data output.
  • Improve allowable input formats.
  • Improve error messaging to the user.

@sonarqubecloud
Copy link
Copy Markdown

@jdw-creare
Copy link
Copy Markdown
Contributor

I'm a little intrigued - can you say more about the specific layer configuration that was unpickleable? Feel free to message me if that involves too many customer specifics to post here

assert status == HTTPStatus.OK

assert content["domain"]["ranges"][parameter_name]["axisNames"] == list(layers[0].node.find_coordinates()[0].dims)
assert set(content["domain"]["ranges"][parameter_name]["axisNames"]) == {"lat", "lon", "time"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i enjoy this use of set

Comment on lines +603 to +604
"start": x_arr[0] if len(x_arr) > 0 else None,
"stop": x_arr[-1] if len(x_arr) > 0 else None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good additional case handling!


if crs.lower() not in [key.lower() for key in settings.EDR_CRS.keys()]:
raise ProviderInvalidQueryError("Invalid CRS provided.")
msg = f"Invalid CRS provided, expected one of {', '.join(settings.EDR_CRS.keys())}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like all these more-informative error messages!

It's always worth thinking about, from a security persepective, whether providing additional information with an error message will reveal anything that would aid an attacker. The list of supported CRS's is not a private piece of information, and all the other messages also look good to me, I just figured I'd mention it.

Copy link
Copy Markdown
Contributor

@jdw-creare jdw-creare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me! I have no changes to recommend so I'll merge it!

@jdw-creare jdw-creare merged commit cbc450c into develop Jan 2, 2026
5 checks passed
@jdw-creare
Copy link
Copy Markdown
Contributor

I'm a little intrigued - can you say more about the specific layer configuration that was unpickleable? Feel free to message me if that involves too many customer specifics to post here

For posterity: Sam answered this question in a private message

@scranford1 scranford1 deleted the bugfix/layer_configuration branch February 3, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants